<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        body{
            margin: 0;
            height: 4000px;
        }
        .top{
            height: 100px;
            background-color: yellow;
        }
        .main{
            height: 1200px;
            background-color: green;
        }
        .banner{
            height: 100px;
            background-color: skyblue;
        }
        .footer{
            height: 200px;
            background-color: aquamarine;
        }
        .sticky{
            position: sticky;
            /* 一开始固定定位 */
            bottom: 0;
        }
    </style>
</head>
<body>
    <div class="top"></div>
    <div class="main"></div>
    <div class="banner sticky"></div>
    <div class="footer"></div>
</body>
</html>